package cn.aezo.minions.web.controller;

import cn.aezo.minions.common.Result;
import cn.aezo.minions.gen.GenService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

/**
 * Created by smalle on 2017/10/18.
 */
@Slf4j
@RestController
@RequestMapping("/api")
public class GeneratorController {
    @Autowired
    private GenService projectService;

    @RequestMapping(path = "/initProject", method = RequestMethod.POST)
    public Object initProject(Long projectConfigId) {
        log.info("genProject start......");

        Result result = projectService.genProject(projectConfigId);

        log.info("genProject end.");
        return result;
    }
}
